<template>
    <div class="box-heading">
        <div @click="handleSelect(0)" class="select">
            全部
        </div>
        <div @click="handleSelect(item.id)" class="select" v-for="item in props.citiestitle" :key="item.id">
            {{ item.cityName }}
        </div>
    </div>
</template>

<script setup>
const emits = defineEmits(['getCityId'])
const props = defineProps({
    citiestitle: {
        type: Array,
        default: []
    },
})
const handleSelect = (val) => {
    emits('getCityId', val)
}
</script>


<style lang="scss" scoped>
.box-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.box-heading .select {
    padding: 1rem 2.5rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    color: #4f5665;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    margin: 0 .5rem;
}

.box-heading .select:hover,
.box-heading .select:active {
    color: #fff;
    background: linear-gradient(to bottom, #fccb90, #ff9a9e);
    box-shadow: 0 5px 15px rgba(255, 94, 58, 0.2);
}

@media (max-width:768px) {
    .box-heading .select {
        font-size: 1.6rem;
    }
}
</style>